More on variables

So far you have met procedures similar to the following:

TO SQUARE :N

REPEAT 4 [FD :N RT 90]

END

TO SHAPE :X

REPEAT 5 [FD :X RT 72]

END

What do you think the following represent on the screen:

TO TRI :P

REPEAT 3 [FD :P RT 120]

END

TO HEX :Y

REPEAT 6 [FD :Y RT 60]

END

Discuss your ideas with someone before testing out what you think you see in your mind's eye.
Looking again at the numbers  3 and 120;  4 & 90; 5 & 72 and  6 & 60 perhaps you could not help but do notice that their product is always 360.

Have you an explanation for this phenomena?

Can you continue with:
7 and ?
8 and ?
9 and ?
10 and ?
12 and ?
13 and ?
14 and ?
and so on…..


Does this help make sense of the following procedure:

TO POLY :N :SIDE

REPEAT :N [ FD :SIDE  RT 360/:N]

END

 


Try with POLY 13 65

If you can, discuss your ideas with someone before testing out what you think you see in your mind's eye.

Experiment further with:
POLY 15 60
POLY 17 54
POLY 19 40
Etc
What is happening as the value of :N increases?
What will result if the variables were respectively:


Variable?

:N

:SIDE

1st

20

20

2nd

40

20

3rd

60

20

4th

80

20

Discuss your ideas with someone before testing out what you think you see in your mind's eye.

Can you imagine what is happening to the polygon as  you increase the number of sides?

What do you think POLY 360 5 looks like?